<?php use_helper('PA_Links') ?>
<?php if(isset($handler)): ?>
<script type="text/javascript">
  $(window).unload(function(){
    <?php echo "opener.App.Table.$handler()";?>
  });
  
</script>
<?php endif;  ?>
<div class="sComponentContainer">
  <div class="sComponent floatLeft">
    <p id="title">Parametry kategorii magazynowych</p>
    <table id="paramsTable">
      <th>Lp.</th>
      <th>Nazwa</th>
      <th>Domyślnie</th>
      <th>J.m.</th>
      <th>Edycja</th>
      <?php if($params): ?>
      <?php foreach($params as $param): ?>
      <tr>
        <td><p id="counter"></p></td>
        <td><?php echo $param->getName() ?></td>
        <td><?php echo $param->getDefaultValue() ?></td>
        <td><?php echo $param->getUnit() ?></td>
        <td nowrap="nowrap">
          <img src="/images/icons/change.png" class="middle" width="18" height="18"/>  <a class="middle">Zmień</a>
          <img src="/images/icons/delete.png" class="middle" width="18" height="18"/>  <a href="<?php echo link_to_app('Store', 'deleteParam', array('id' => $param->getId())) ?>" class="middle">Usuń</a>
        </td>
      </tr>
      <?php endforeach; ?>
      <?php endif; ?>
      <tr id="add">
        <td colspan="5"><img src="/images/icons/add.png" class="middle" width="18" height="18"/>  <a onclick="App.Table.attachForm(this, '<?php echo link_to_app('Core', 'homeGetForm', array('form' => 'ParametersForm', 'form_action' => 'create')) ?>', '#paramsTable', 'createParam', 3, 3, true)" class="middle">Dodaj</a></td>
      </tr>
    </table>
  </div>
</div>
